-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rename TopographicMap => SubsurfaceMap. Add global colorscale #302
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could consider moving the color scale function into ColorScale
since it is going to be consumed in several map modules. Otherwise, two small comments.
|
||
import { formatRgb } from "culori"; | ||
|
||
function rgbStringToArray(rgbString: string): number[] | null { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider removing this function when implementing the suggestion below.
Otherwise:
function rgbStringToTuple(rgbString: string): [number, number, number] | null
const hexColors = colorScale.getPlotlyColorScale(); | ||
const rgbArr: [number, number, number, number][] = []; | ||
hexColors.forEach((color) => { | ||
const rgbString: string = formatRgb(color[1]) as string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://culorijs.org/api/#parse
import { parse } from "culori";
...
hexColors.forEach((hexColor) => {
const rgbColor = parse(hexColor); // Returns object with r, g, b items for hex strings
rgbArr.push([hexColor[0], rgbColor.r, rgbColor.g, rgbColor.b]);
});
0ff6304
to
35651ef
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
No description provided.